<template>
  <wd-button v-bind="props" @click="handleClick">
    <slot></slot>
  </wd-button>
</template>

<script lang="ts" setup>
import { throttle } from '@/utils/throttle'
import { buttonProps } from 'wot-design-uni/components/wd-button/types'
const props = defineProps(buttonProps)
const emit = defineEmits(['click'])
const handleClick = throttle((event: MouseEvent) => {
  if (!props.disabled && !props.loading) {
    emit('click', event)
  }
}, 500)
</script>

<style lang="scss" scoped></style>
